Inside Macintosh: QuickTime Components

Previous | Chapter Top | Chapter Contents | Next

Image Compression Manager Utility Functions

The Image Compression Manager provides a number of utility functions for use by your compressor component. These utility functions allow compressor components to manipulate the Image Compression Manager's image description structures.

SetImageDescriptionExtension

Your component may use the SetImageDescriptionExtension function to create or update the extended data for an image.

pascal OSErr SetImageDescriptionExtension
                                         (ImageDescriptionHandle desc,
                                          Handle extension,
                                          long idType);
desc
Contains a handle to the appropriate image description structure. The SetImageDescriptionExtension function updates the size of the image description to accommodate the new extended data.
extension
Contains a handle to the new extended data. The SetImageDescriptionExtension function uses this data to update the extended data for the image described by the image description referred to by the desc parameter.
idType
Specifies the extension's type value. Use this parameter to assign a data type to the extension. Use a four-character code, similar to an OSType field value.

DESCRIPTION

The Image Compression Manager appends the extended data for an image to the appropriate image description structure (see the chapter "Image Compression Manager" in Inside Macintosh: QuickTime for information about image description structures). Note that each compressor type may have its own format for the extended data that is stored with an image. The extended data is similar in concept to the user data that applications can associate with QuickTime movies--see the chapter "Movie Toolbox" in Inside Macintosh: QuickTime for more information about user data in QuickTime movies. Once you have added extended data to an image, you cannot delete it.

RESULT CODES

noErr

0

No error

paramErr

-50

Invalid parameter specified

memFullErr

-108

Not enough memory available

noCodecErr

-8961

Image Compression Manager could not find the specified compressor

codecExtensionNotFoundErr

-8971

Requested extension is not in the image description

GetImageDescriptionExtension

Your component may use the GetImageDescriptionExtension function to obtain the extended data for an image.

pascal OSErr GetImageDescriptionExtension
                                          (ImageDescriptionHandle desc,
                                         Handle *extension,
                                         long idType, long index);
desc
Contains a handle to the appropriate image description structure.
extension
Contains a pointer to a field to receive a handle to the returned data. The GetImageDescriptionExtension function returns the extended data for the image described by the image description referred to by the desc parameter. The function correctly sizes the handle for the data it returns.
idType
Specifies the extension's type value. Use this parameter to determine the data type of the extension. This parameter contains a four-character code, similar to an OSType field value.
index
Specifies the extension's index value.

DESCRIPTION

The Image Compression Manager appends the extended data for an image to the appropriate image description structure (see the chapter "Image Compression Manager" in Inside Macintosh: QuickTime for information about image description structures). Note that each compressor type may have its own format for the extended data that is stored with an image. The extended data is similar in concept to the user data that applications can associate with QuickTime movies--see the chapter "Movie Toolbox" in Inside Macintosh: QuickTime for more information about user data in QuickTime movies. Once you have added extended data to an image, you cannot delete it.

RESULT CODES

noErr

0

No error

paramErr

-50

Invalid parameter specified

memFullErr

-108

Not enough memory available

noCodecErr

-8961

The Image Compression Manager could not find the specified compressor

codecExtensionNotFoundErr

-8971

Requested extension is not in the image description

RemoveImageDescriptionExtension

The RemoveImageDescriptionExtension function allows you to remove an extension based on its type or index.

pascal OSErr RemoveImageDescriptionExtension
                                         (ImageDescriptionHandle desc,
                                          long type, long index);
desc
Contains a handle to the appropriate image description structure.
type
Specifies the extension's type, starting at 1. Use this parameter to specify the data type of the extension to be removed. This parameter contains a four-character code, similar to an OSType field value. Set the value of this parameter to 0 to indicate that any extension should be matched, with the index parameter becoming an index into all of the extensions.
index
Specifies the extension's index value.

RESULT CODE

codecExtensionNotFoundErr

-8971

Requested extension is not in the image description

CountImageDescriptionExtensionType

The CountImageDescriptionExtensionType function counts the number of image description extensions in a specified image description structure.

pascal OSErr CountImageDescriptionExtensionType
                                         (ImageDescriptionHandle desc,
                                          long type, long *count);
desc
Contains a handle to the image description structure with the extensions to be counted.
type
Indicates the type of extension to be counted in the specified image description structure. Set the value of this parameter to 0 to match any extension, and return a count of all of the extensions.
count
Contains a pointer to an integer that indicates how many extensions of the given type are in the given image description structure.

GetNextImageDescriptionExtensionType

The GetNextImageDescriptionExtensionType function retrieves the next extension type encountered after the one you specify.

pascal OSErr GetNextImageDescriptionExtensionType
                                          (ImageDescriptionHandle desc, long *type);
desc
Contains a handle to the image description structure with the extension under scrutiny.
type
Contains a pointer to an integer that indicates the type of the extension after which this function is to return the next extension type. Set the value of this parameter to 0 to return the first type found. Point to a value of 0 to return the first type found.

DESCRIPTION

If GetNextImageDescriptionExtensionType returns a value of 0 in the type parameter, no more types could be found.


© 1997 Apple Computer, Inc.

Previous | Chapter Top | Chapter Contents | Next